package chapter12;

import chapter9.DynamicArray;

import java.util.AbstractSequentialList;
import java.util.Collection;
import java.util.ListIterator;

/**
 * @author lzy
 * @version v1.0
 * Create DateTime: 2019/2/20 11:19
 */
public class MySeqList<E> extends AbstractSequentialList<E> {
    private DynamicArray<E> dynamicArray;

    public MySeqList() {
        this.dynamicArray = new DynamicArray<>();
    }

    public MySeqList(Collection<? extends E> collection) {
        this();
        addAll(collection);
    }

    @Override
    public ListIterator<E> listIterator(int index) {
        return dynamicArray.listIterator(index);
    }

    @Override
    public int size() {
        return dynamicArray.size();
    }
}
